Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-class-properties

Package Overview
Dependencies
Maintainers
6
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-class-properties

This plugin transforms static class properties as well as properties declared with the property initializer syntax

  • 6.24.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created

What is babel-plugin-transform-class-properties?

The babel-plugin-transform-class-properties package is a Babel plugin that allows you to use class properties in your JavaScript code. This plugin transforms class properties to be compatible with older JavaScript environments that do not support this feature natively.

What are babel-plugin-transform-class-properties's main functionalities?

Public Class Fields

This feature allows you to define public class fields directly within the class body. The plugin transforms this syntax to be compatible with older JavaScript environments.

class MyClass {
  myField = 'Hello, world!';
}

Static Class Fields

This feature allows you to define static class fields directly within the class body. Static fields are shared among all instances of the class. The plugin ensures this syntax works in environments that do not support it natively.

class MyClass {
  static myStaticField = 'Hello, static world!';
}

Instance Property Initialization

This feature allows you to initialize instance properties directly within the class body, making the code more concise and readable. The plugin transforms this syntax to be compatible with older JavaScript environments.

class MyClass {
  myField = 'Hello, world!';
  constructor() {
    console.log(this.myField);
  }
}

Other packages similar to babel-plugin-transform-class-properties

Keywords

FAQs

Package last updated on 07 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc